#!/usr/bin/python
# -*- coding: UTF-8 -*-
i =float(raw_input('当月所发工资：'));
arr=[3500,8000,20000];
rat=[0.02,0.05,0.1];
r=0;  #个税的金额
for idx in range(0,2):
    if i>arr[idx]:
        r+=(i-arr[idx])*rat[idx]
        print (i-arr[idx])*rat[idx]
        i=arr[idx]
print r;
